(function($){
	
	$(function(){		//onready
		
		var $form = $('form[id!=szamlatukorXlsxForm]'),
			$input = $(':text'),
			selectedId;
		
		$input.autocomplete(
								  laksmi.autocompletefactory({url : $form.attr('action').replace(/edit/, 'search')})
								  );
		
		$form.submit(function(e){
			location.href = $form.attr('action') + '/' + $input.data('selectedId');		//do not submit just redirect to edit page
			e.preventDefault();
		});
		
	});
})(jQuery);